package com.xgggh.redpack.ui.home.viewbinder;

import android.text.Html;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import com.xgggh.redpack.R;
import com.xgggh.redpack.base.viewbinder.BaseItemViewBinder;
import com.xgggh.redpack.base.viewbinder.BinderViewHolder;
import com.xgggh.redpack.databinding.ContentActivityItemBinding;
import com.xgggh.redpack.domain.activity.ActivityItem;

public class ActivityViewBinder extends BaseItemViewBinder<ActivityItem>  {

    @NonNull
    @Override
    public int getResId() {
        return R.layout.content_activity_item;
    }


    protected void onBindViewHolder(@NonNull BinderViewHolder holder, @NonNull ActivityItem item) {
        super.onBindViewHolder(holder, item);
        ContentActivityItemBinding binding= DataBindingUtil.getBinding(holder.itemView);
        binding.setItem(item);
        binding.message.setText(Html.fromHtml(item.getContent()));
    }
}
